<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="erp" uri="/erp-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">
<link rel="stylesheet"
	href="<%=basePath%>script/jquery-ui-1.10.4/themes/base/jquery.ui.all.css">
<script src="<%=basePath%>script/jquery-ui-1.10.4/jquery-1.10.2.js"></script>
<script src="<%=basePath%>script/jquery-ui-1.10.4/ui/jquery.ui.core.js"></script>
<script
	src="<%=basePath%>script/jquery-ui-1.10.4/ui/jquery.ui.widget.js"></script>
<script
	src="<%=basePath%>script/jquery-ui-1.10.4/ui/jquery.ui.button.js"></script>
<script src="<%=basePath%>script/script.js"></script>
<link rel="stylesheet"
	href="<%=basePath%>script/jquery-ui-1.10.4/demos/demos.css">
<link rel="stylesheet" href="<%=basePath%>style/style.css">
<script>
	$(function() {
		init_list_page();
	});
</script>
</head>
<body>

	<div class="ui-widget list_container center" style="width: 90%">
		<h1>流程定义管理</h1>
		
		<table class="condition">
			<tr>
				<td>流程定义名称</td>
				<td>
					<input type="text" />
					<a href="javascript:alert('未完成功能')" id="btnChoose">选择</a>
				</td>
				<td>部署时间：</td>
				<td>
					<input type="text" name="leaveTime" id="from" />
					到
					<input type="text" id="to" />
				</td>
				<td>部署人：</td>
				<td><input type="text" /></td>
			</tr>
		</table>
		
		<table class="ui-widget ui-widget-content">
			<thead>
				<tr class="ui-widget-header ">
					<th>流程ID</th>
					<th>流程定义名称</th>
					<th>最新版本</th>
					<th>描述</th>
					<th>最近部署时间</th>
					<th>部署人</th>
					<th colspan="4">操作</th>
				</tr>
			</thead>
			<tbody id="table_content">
				<s:iterator value="%{#request.procDefList}">
					<tr>
						<td>${procDefId}</td>
						<td>${name}</td>
						<td>${version}</td>
						<td>${description}</td>
						<td><s:date name="%{deployTime}" format="yyyy-MM-dd HH:mm" /></td>
						<td>${deployUser.name}</td>
						<td>
							<s:if test="%{state==1}">
								<s:a action="apply_addPage?procDefKey=%{key}">开始申请</s:a>
							</s:if>
							<s:else>
								<a href="javascript:;" title="请先启用流程" onclick="alert('请先启用流程');" >开始申请</a>
							</s:else>
						</td>
						<td><s:a action="workflow_showProcDefImage?procDefId=%{procDefId}" cssClass="a_show_img">查看流程图</s:a></td>
						<td>
							<%-- <s:property value="state"/> --%>
							<s:if test="%{state==1}">
								<s:a action="workflow_suspendProcDef?key=%{key}">禁用该流程</s:a>
							</s:if>
							<s:else>
								<s:a action="workflow_activateProcDef?key=%{key}">启用该流程</s:a>
							</s:else>
						
						</td>
						<td><s:a action="workflow_delete?key=%{key}" cssClass="a_delete">删除</s:a></td>
					</tr>
				</s:iterator>
			</tbody>
		</table>
		<s:a action="workflow_deployProcDefPage" id="a_add_procDef">部署流程定义文档</s:a>
		<s:debug></s:debug>
</body>
</html>
